package cn.edu.scau.cmi.yewangjiang.client;
import java.util.Scanner;
import cn.edu.scau.cmi.yewangjiang.abstractFactory.*;
import cn.edu.scau.cmi.yewangjiang.abstractFactory.domain.*;
import cn.edu.scau.cmi.yewangjiang.abstractFactory.domainAbstractClass.*;
import cn.edu.scau.cmi.yewangjiang.abstractFactory.domainInterface.*;
import cn.edu.scau.cmi.yewangjiang.abstractFactory.factory.*;

public class AbstractFactoryClient {

	public static void main(String[] args) {
		
		//(1)选择品牌
		System.out.println("Please select which brand you want to buy: aonong, tianbang or wens???");
		Scanner scanner = new Scanner(System.in);  
		String brandKind = scanner.next();  
		brandKind=brandKind.toLowerCase();
		AbstractFactory factory=null;
		switch(brandKind){
		case "aonong": factory=new AonongFactory();break;
		case "tiangbang": factory=new TianbangFactory();break;
		case "wens": factory=new WensFactory();break;
		default:System.out.println("sorry, your input is not correct");
		}
	
		
		//(2)选择肉类
		System.out.println("Please select which meat you want to buy: beef, chicken or pork???");
		String meatType = scanner.next();  
		meatType=meatType.toLowerCase();
		ConsumerMeat meat=null;
		switch(meatType) {
		case "beef": meat=factory.createBeef();break;
		case "chicken": meat=factory.createChicken();break;
		case "pork": meat=factory.createPork();break;
		default:System.out.println("sorry, your input is not correct");	
		}
		if(meat!=null) {
			meat.play();
		}

	}

}
